package liumengbaio.lolzhangyoubao.Activity.utils;

import android.content.Context;

import org.json.JSONObject;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import liumengbaio.lolzhangyoubao.Activity.InFo.AllHeroInfo;

/**
 * Created by lanouhn on 16/8/29.
 */
public class AllHeroManUtils {
    /**
     * 全部英雄的获取方法
     */


    public static List<AllHeroInfo> getAllHerosList(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));
                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
       return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan1000(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("1000")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan1500(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("1500")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan2000(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("2000")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan2500(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("2500")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan3000(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("3000")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan3500(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("3500")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan4000(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("4000")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan4500(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("point").equals("4500")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan450(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("money").equals("450")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan1350(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("money").equals("1350")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan3150(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("money").equals("3150")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan4800(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("money").equals("4800")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
    public static List<AllHeroInfo> getAllHerosMan6300(Context context) {
        List<AllHeroInfo> ahlist = new ArrayList<>();
        try {
            for (int i = 1; i <= 132; i++) {
                if (i > 129) {
                    i += 1;
                }
                InputStream is = context.getAssets().open("hero/" + i + ".json");
                // Read the entire asset into a local byte buffer.
                byte[] buffer = new byte[is.available()];
                is.read(buffer);
                is.close();

                // Convert the buffer into a string.
                String text = new String(buffer, "UTF-8");
                JSONObject hJson = new JSONObject(text);
                AllHeroInfo nfhinfo = new AllHeroInfo();
                if (hJson.getString("filter").equals("战士")&&hJson.getString("money").equals("6300")) {
                    nfhinfo.setNickname(hJson.getString("nickname"));
                    nfhinfo.setPic_url(hJson.getString("pic_url"));
                    nfhinfo.setMoney(hJson.getString("money"));
                    nfhinfo.setPoint(hJson.getString("point"));
                    nfhinfo.setName(hJson.getString("name"));
                    nfhinfo.setFilter(hJson.getString("filter"));
                    nfhinfo.setId(hJson.getString("id"));
                    nfhinfo.setBase_physical(hJson.getString("base_physical"));
                    nfhinfo.setBase_magic(hJson.getString("base_magic"));
                    nfhinfo.setBase_blood(hJson.getString("base_blood"));
                    nfhinfo.setBase_difficulty(hJson.getString("base_difficulty"));
                    nfhinfo.setMoving_speed(hJson.getString("moving_speed"));
                    nfhinfo.setRange(hJson.getString("range"));
                    nfhinfo.setAttack(hJson.getString("attack"));
                    nfhinfo.setAttack_speed(hJson.getString("attack_speed"));
                    nfhinfo.setArmor(hJson.getString("armor"));
                    nfhinfo.setBlood(hJson.getString("blood"));
                    nfhinfo.setMana(hJson.getString("mana"));
                    nfhinfo.setMagic_resistance(hJson.getString("magic_resistance"));
                    nfhinfo.setBlood_recovery(hJson.getString("blood_recovery"));
                    nfhinfo.setMagic_recovery(hJson.getString("magic_recovery"));
                    nfhinfo.setUsetip(hJson.getString("usetip"));
                    nfhinfo.setKilltip(hJson.getString("killtip"));
                    nfhinfo.setBg(hJson.getString("bg"));

                }
                if (nfhinfo.getNickname()!=null){
                    ahlist.add(nfhinfo);
                }

            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        return ahlist;

    }
}

